<template>
  <div class="loading" v-show="loading">
    <van-loading class="center" type="spinner" color="#1989fa">
      <slot></slot>
    </van-loading>
  </div>
</template>
<script>
export default {
  name: 'Loading',
  props: {
    loading: {
      type: Boolean,
      default: true
    }
  }
}
</script>
<style lang="less" scoped>
.loading {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.3);
  .center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
